package com.gzy.cbrsystem.shimian.dao;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 * A data access object (DAO) providing persistence and search support for
 * ShimianZdbs entities. Transaction control of the save(), update() and
 * delete() operations can directly support Spring container-managed
 * transactions or they can be augmented to handle user-managed Spring
 * transactions. Each of these methods provides additional information for how
 * to configure it for the desired type of transaction control.
 * 
 * @see com.gzy.cbrsystem.shimian.dao.ShimianZdbs
 * @author MyEclipse Persistence Tools
 */

public class ShimianZdbsDAO extends HibernateDaoSupport {
	private static final Log log = LogFactory.getLog(ShimianZdbsDAO.class);
	// property constants
	public static final String XYBB1 = "xybb1";
	public static final String XYBB2 = "xybb2";
	public static final String XYBB3 = "xybb3";
	public static final String XYBB4 = "xybb4";
	public static final String XYBB5 = "xybb5";
	public static final String JTMS = "jtms";
	public static final String HBQTJB = "hbqtjb";
	public static final String ZYBB1 = "zybb1";
	public static final String ZYBB2 = "zybb2";
	public static final String ZYBB3 = "zybb3";
	public static final String ZYBB_QT = "zybbQt";
	public static final String ZLJU1 = "zlju1";
	public static final String ZLJU2 = "zlju2";
	public static final String ZLJU3 = "zlju3";
	public static final String ZLJU4 = "zlju4";
	public static final String ZLJU5 = "zlju5";
	public static final String ZLJU6 = "zlju6";
	public static final String ZLJU7 = "zlju7";
	public static final String ZLJU8 = "zlju8";
	public static final String ZLJU9 = "zlju9";
	public static final String ZLJU10 = "zlju10";
	public static final String ZLJU11 = "zlju11";
	public static final String ZLJU12 = "zlju12";
	public static final String ZLJU13 = "zlju13";
	public static final String ZLJU14 = "zlju14";
	public static final String ZLJU15 = "zlju15";
	public static final String BZBS1 = "bzbs1";
	public static final String BZBS2 = "bzbs2";
	public static final String BZBS3 = "bzbs3";
	public static final String BZBS4 = "bzbs4";
	public static final String BZBS5 = "bzbs5";
	public static final String BZBS6 = "bzbs6";
	public static final String BZBS7 = "bzbs7";
	public static final String BZBS8 = "bzbs8";
	public static final String BZBS9 = "bzbs9";
	public static final String BZBS10 = "bzbs10";
	public static final String BZBS11 = "bzbs11";
	public static final String BZBS12 = "bzbs12";
	public static final String BZBS13 = "bzbs13";

	protected void initDao() {
		// do nothing
	}

	public void save(ShimianZdbs transientInstance) {
		log.debug("saving ShimianZdbs instance");
		try {
			getHibernateTemplate().save(transientInstance);
			log.debug("save successful");
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}

	public void delete(ShimianZdbs persistentInstance) {
		log.debug("deleting ShimianZdbs instance");
		try {
			getHibernateTemplate().delete(persistentInstance);
			log.debug("delete successful");
		} catch (RuntimeException re) {
			log.error("delete failed", re);
			throw re;
		}
	}

	public ShimianZdbs findById(java.lang.String id) {
		log.debug("getting ShimianZdbs instance with id: " + id);
		try {
			ShimianZdbs instance = (ShimianZdbs) getHibernateTemplate().get(
					"com.gzy.cbrsystem.shimian.dao.ShimianZdbs", id);
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}

	public List findByExample(ShimianZdbs instance) {
		log.debug("finding ShimianZdbs instance by example");
		try {
			List results = getHibernateTemplate().findByExample(instance);
			log.debug("find by example successful, result size: "
					+ results.size());
			return results;
		} catch (RuntimeException re) {
			log.error("find by example failed", re);
			throw re;
		}
	}

	public List findByProperty(String propertyName, Object value) {
		log.debug("finding ShimianZdbs instance with property: " + propertyName
				+ ", value: " + value);
		try {
			String queryString = "from ShimianZdbs as model where model."
					+ propertyName + "= ?";
			return getHibernateTemplate().find(queryString, value);
		} catch (RuntimeException re) {
			log.error("find by property name failed", re);
			throw re;
		}
	}

	public List findByXybb1(Object xybb1) {
		return findByProperty(XYBB1, xybb1);
	}

	public List findByXybb2(Object xybb2) {
		return findByProperty(XYBB2, xybb2);
	}

	public List findByXybb3(Object xybb3) {
		return findByProperty(XYBB3, xybb3);
	}

	public List findByXybb4(Object xybb4) {
		return findByProperty(XYBB4, xybb4);
	}

	public List findByXybb5(Object xybb5) {
		return findByProperty(XYBB5, xybb5);
	}

	public List findByJtms(Object jtms) {
		return findByProperty(JTMS, jtms);
	}

	public List findByHbqtjb(Object hbqtjb) {
		return findByProperty(HBQTJB, hbqtjb);
	}

	public List findByZybb1(Object zybb1) {
		return findByProperty(ZYBB1, zybb1);
	}

	public List findByZybb2(Object zybb2) {
		return findByProperty(ZYBB2, zybb2);
	}

	public List findByZybb3(Object zybb3) {
		return findByProperty(ZYBB3, zybb3);
	}

	public List findByZybbQt(Object zybbQt) {
		return findByProperty(ZYBB_QT, zybbQt);
	}

	public List findByZlju1(Object zlju1) {
		return findByProperty(ZLJU1, zlju1);
	}

	public List findByZlju2(Object zlju2) {
		return findByProperty(ZLJU2, zlju2);
	}

	public List findByZlju3(Object zlju3) {
		return findByProperty(ZLJU3, zlju3);
	}

	public List findByZlju4(Object zlju4) {
		return findByProperty(ZLJU4, zlju4);
	}

	public List findByZlju5(Object zlju5) {
		return findByProperty(ZLJU5, zlju5);
	}

	public List findByZlju6(Object zlju6) {
		return findByProperty(ZLJU6, zlju6);
	}

	public List findByZlju7(Object zlju7) {
		return findByProperty(ZLJU7, zlju7);
	}

	public List findByZlju8(Object zlju8) {
		return findByProperty(ZLJU8, zlju8);
	}

	public List findByZlju9(Object zlju9) {
		return findByProperty(ZLJU9, zlju9);
	}

	public List findByZlju10(Object zlju10) {
		return findByProperty(ZLJU10, zlju10);
	}

	public List findByZlju11(Object zlju11) {
		return findByProperty(ZLJU11, zlju11);
	}

	public List findByZlju12(Object zlju12) {
		return findByProperty(ZLJU12, zlju12);
	}

	public List findByZlju13(Object zlju13) {
		return findByProperty(ZLJU13, zlju13);
	}

	public List findByZlju14(Object zlju14) {
		return findByProperty(ZLJU14, zlju14);
	}

	public List findByZlju15(Object zlju15) {
		return findByProperty(ZLJU15, zlju15);
	}

	public List findByBzbs1(Object bzbs1) {
		return findByProperty(BZBS1, bzbs1);
	}

	public List findByBzbs2(Object bzbs2) {
		return findByProperty(BZBS2, bzbs2);
	}

	public List findByBzbs3(Object bzbs3) {
		return findByProperty(BZBS3, bzbs3);
	}

	public List findByBzbs4(Object bzbs4) {
		return findByProperty(BZBS4, bzbs4);
	}

	public List findByBzbs5(Object bzbs5) {
		return findByProperty(BZBS5, bzbs5);
	}

	public List findByBzbs6(Object bzbs6) {
		return findByProperty(BZBS6, bzbs6);
	}

	public List findByBzbs7(Object bzbs7) {
		return findByProperty(BZBS7, bzbs7);
	}

	public List findByBzbs8(Object bzbs8) {
		return findByProperty(BZBS8, bzbs8);
	}

	public List findByBzbs9(Object bzbs9) {
		return findByProperty(BZBS9, bzbs9);
	}

	public List findByBzbs10(Object bzbs10) {
		return findByProperty(BZBS10, bzbs10);
	}

	public List findByBzbs11(Object bzbs11) {
		return findByProperty(BZBS11, bzbs11);
	}

	public List findByBzbs12(Object bzbs12) {
		return findByProperty(BZBS12, bzbs12);
	}

	public List findByBzbs13(Object bzbs13) {
		return findByProperty(BZBS13, bzbs13);
	}

	public List findAll() {
		log.debug("finding all ShimianZdbs instances");
		try {
			String queryString = "from ShimianZdbs";
			return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}

	public ShimianZdbs merge(ShimianZdbs detachedInstance) {
		log.debug("merging ShimianZdbs instance");
		try {
			ShimianZdbs result = (ShimianZdbs) getHibernateTemplate().merge(
					detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public void attachDirty(ShimianZdbs instance) {
		log.debug("attaching dirty ShimianZdbs instance");
		try {
			getHibernateTemplate().saveOrUpdate(instance);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public void attachClean(ShimianZdbs instance) {
		log.debug("attaching clean ShimianZdbs instance");
		try {
			getHibernateTemplate().lock(instance, LockMode.NONE);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public static ShimianZdbsDAO getFromApplicationContext(
			ApplicationContext ctx) {
		return (ShimianZdbsDAO) ctx.getBean("ShimianZdbsDAO");
	}
}